<%@page import="models.GeoModel"%>
<%@page import="data.GeoData"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String city = "";
	Cookie cookies [] = request.getCookies();	
	if (cookies != null)
	{
		for (int i = 0; i < cookies.length; i++) 
		{
			if (cookies [i].getName().equals ("city"))
			{
				city = cookies[i].getValue();
				break;
			}
		}
	}
	if(city.equals("")){
		GeoData geoData = new GeoData();
		GeoModel currentCity = geoData.getFirstCity();
		city = currentCity.getAlias();
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>GroupOn</title>
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<script type="text/javascript" src="/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" language="javascript">
	var count = 4;
	var countdown = setInterval(function(){
	  $("#countdown").html(count);
	  if (count == 0) {
	    clearInterval(countdown);
	    window.open('/<%=city%>', "_self");
	  }
	  count--;
	}, 1000);    
</script>
</head>
 
<body class="errorPage">
	<div id="master">
		<div class="errorContainer clearafter">
        	<div class="left">
            	<a href="#"><img src="/images/logo.png" /></a>
            </div>
            <div class="right">            	
                <h2>Xin lỗi!</h2>
                <div>Không thấy trang truy cập</div>
                <div>Lỗi <span class="redColor">404</span></div>
                
                <p>Tự động trở về trang chủ trong <span id="countdown">5</span> giây</p>
                
                <p><a href="/<%=city%>">Trở về</a></p>
                
                <p><a href="/<%=city%>">Trở về trang chủ</a></p>
            </div>
        </div>
    </div>
</body>
</html>